Cavern

 Cavern4D

 Cavernize

 Debug

 FilterInterfaces

 Filters

 Format

 Helpers

 QuickEQ

 Remapping

 SpecialSources

 Spoofer

 Utilities

 Virtualizer

 Atmosphere

 AudioClip3D

 AudioListener3D

 AudioListener3DInspector

 AudioSource3D

 CavernizeRealtime

 Channel

 Clip

 Environments

 Jack

 Listener

 QualityModes

 Rolloffs

 SeatAdaptation

 Source

  AddFilter(Filter)

  bool Precollect()

  bool Renderable

  Clip

  CopySettings(Source)

  DistanceSimulation

  DopplerLevel

  float[] Collect()

  float[][] GetSamples()

  ForcePrecollect()

  IsPlaying

  LFE

  Listener listener

  Loop

  Mute

  operator bool(Source)

  Pause()

  Pitch

  PitchedUpdateRate

  Play(long)

  PlayDelayed(float)

  Position

  RandomPosition()

  RemoveFilter(Filter)

  Rendered

  screenLocked

  Size

  SpatialBlend

  SpatialFilter

  SpeedOfSound

  stereoPan

  Stop()

  TimeSamples

  TogglePlay()

  UnPause()

  Volume

  VolumeRolloff

class Source

An audio object in 3D space, in stereo, or both.
VisibilityPublic

Public functions

void AddFilter(Filter target)Add a new SpatialFilter to this source.
void CopySettings(Source from)Copy the settings of another Source.
void Pause() Pause playback if it's not paused.
void Play(long delaySamples = 0)Start playback from the beginning of the Clip.
void PlayDelayed(float seconds) Start playback from the beginning after the given time.
void RandomPosition() Jump to a random position.
void RemoveFilter(Filter target)Remove a SpatialFilter from this source.
void Stop()Pause playback and reset position. The next UnPause will start playback from the beginning.
void TogglePlay() Toggle between playback and pause.
void UnPause() Continue playback if it's paused.

Public static functions

implicit operator bool(Source source) Implicit null check.

Protected functions

internal bool Precollect()Cache the samples if the source should be rendered. This wouldn't be thread safe.
internal float[] Collect()Process the source and returns a mix to be added to the output.
internal float[][] GetSamples()Get the next samples in the audio stream.
void ForcePrecollect() Makes sure if Precollect is called immediatly after this function, it will return true.

Protected properties

internal bool Renderable Indicates that the source meets rendering requirements, and GetSamples won't fail.
int PitchedUpdateRateSamples required to match the listener's update rate after pitch changes.
This is the number of samples that has to be rendered.

Public variables

Clip ClipThe audio clip to play.
bool DistanceSimulationSimulates distance, not just direction when using virtualization.
float DopplerLevelDoppler effect scale, 1 is real.
bool IsPlayingContinue playback of the source.
bool LFEOnly mix this channel to subwoofers.
bool LoopRestart the source when finished.
bool MuteMute the source.
float PitchPlayback speed with no pitch correction.
Vector3 PositionObject position in absolute space.
float[][] RenderedLast collected samples from the clip or the last samples generated by overriding GetSamples.
bool screenLockedThe object position is relative to the screen and scales with screen size.
float SizeAudio source size relative to Listener.EnvironmentSize. 0 is a point, 1 is the entire room.
float SpatialBlendBalance between 1D and 3D mixing. 0 is 1D and 1 is 3D.
Filter SpatialFilterFilter to be applied on the 3D mixed output.
float SpeedOfSoundReference sound velocity in m/s (dry air, 25.4 degrees Celsius).
float stereoPanBalance between left and right channels.
int TimeSamplesClip playback position in samples.
float VolumeSource playback volume (ratio to full volume).
Rolloffs VolumeRolloffVolume decreasing function by distance.

Protected variables

internal Listener listenerThe Listener this source is attached to.

See also

CavernUnity DLL.Cavern.Format.Environment.BroadcastWaveFormatWriter.WriteNextFrame()Export the next frame of the Source.
CavernUnity DLL.Cavern.Helpers.FollowerCreates a sphere that matches the position of a Source. This is useful for visualizing non-Unity-based Cavern features.
CavernUnity DLL.Cavern.SpecialSources.InfiniteSourceA Source with an intro Clip and a looping part after.
CavernUnity DLL.Cavern.Utilities.RenderStatsRecords rendering environment statistics for each Source.
CavernUnity DLL.Cavern.Utilities.RenderStats.RenderStats(Listener listener) Records rendering environment statistics for each Source.
CavernUnity DLL.Cavern.ListenerCenter of a listening space. Attached Sources will be rendered relative to this object's position.
CavernUnity DLL.Cavern.Listener.ActiveSources Attached Sources.
CavernUnity DLL.Cavern.Listener.Listener(bool loadGlobals = true)Center of a listening space. Attached Sources will be rendered relative to this object's position.
CavernUnity DLL.Cavern.Source.CopySettings(Source from)Copy the settings of another Source.